Skip to content

Note that props can be accessed in template directly #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2020

Conversation

garyo
Copy link
Contributor

@garyo garyo commented Sep 16, 2020

In "Usage with Templates" the doc shows how props of the object returned from setup can be used directly in the template, but I didn't find anywhere else in the composition-api doc where it says that props can also be used directly. This seemed like as good a place as any to add that, since that's where I was looking for it first :-).

Description of Problem

Composition API doc doesn't mention that props can be used directly in templates

Proposed Solution

I added a note and changed the example to use props.

Additional Information

In "Usage with Templates" the doc shows how props of the object returned from `setup` can be used directly in the template, but I didn't find anywhere else in the composition-api doc where it says that props can also be used directly. This seemed like as good a place as any to add that, since that's where I was looking for it first :-).
Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garyo thank you for the contribution! I've added a small suggestion there

@garyo
Copy link
Contributor Author

garyo commented Sep 17, 2020

@garyo thank you for the contribution! I've added a small suggestion there

It's OK with me; I struggled with that for a bit because I don't want to imply that you get access to props in the template only if setup returns an object. But I agree that "as can" is a bit archaic.

Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garyo thank you! Happy to merge the change 🎉

@NataliaTepluhina NataliaTepluhina merged commit c05b8e6 into vuejs:master Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants